import request from '@/utils/request'

// 查询栏目临时权限列表
export function listColumnPermission(query) {
  return request({
    url: '/conlumn/permission/list',
    method: 'get',
    params: query
  })
}

// 查询栏目临时权限详细
export function getColumnPermission(id) {
  return request({
    url: '/conlumn/permission/' + id,
    method: 'get'
  })
}

// 新增栏目临时权限
export function addColumnPermission(data) {
  return request({
    url: '/conlumn/permission',
    method: 'post',
    data: data
  })
}

// 修改栏目临时权限
export function updateColumnPermission(data) {
  return request({
    url: '/conlumn/permission',
    method: 'put',
    data: data
  })
}

// 删除栏目临时权限
export function delColumnPermission(id) {
  return request({
    url: '/conlumn/permission/' + id,
    method: 'delete'
  })
}

// 检查栏目临时权限
export function checkColumnPermission(columnId, deptId) {
  return request({
    url: '/conlumn/permission/check/' + columnId + '/' + deptId,
    method: 'get'
  })
}

// 获取所有分局列表
export function getDepts() {
  return request({
    url: '/conlumn/permission/depts',
    method: 'get'
  })
}

// 检查分局是否拥有指定栏目的权限
export function checkDeptPermission(columnId, deptId) {
  return request({
    url: '/conlumn/permission/checkPermission/' + columnId + '/' + deptId,
    method: 'get'
  })
}